<template>
	<view class="">	
		<u-sticky bgColor="#fff">
			<view class="status_bar"></view>
			<u-tabs :list="list1" lineWidth="30" lineColor="#2F6DFE"
			:activeStyle="{
				color: '#2F6DFE',
				fontWeight: 'bold'
			}"
			:inactiveStyle="{
				color: '#3B3E45'
			}"
        itemStyle="width:33%; box-sizing: border-box; height: 97rpx; " @click="clicktab"></u-tabs>
		</u-sticky>
		<view v-show="activeName == 0">
			<history ref="history"></history>
		</view>
		<view v-show="activeName == 1">
			<company ref="company"></company>
		</view>
		<view v-show="activeName == 2">
			<gongneng ref="gongneng"></gongneng>
		</view>
	</view>
</template>

<script>
	import history from './components/history.vue'
	import company from './components/company.vue';
	import gongneng from './components/gongneng.vue';
	export default {
		components:{
			history,
			company,
			gongneng
		},
		data() {
			return {
				list1:[{
					name:'浏览信息'
				},
				{
					name:'浏览企业'
				},
				{
					name:'功能使用'
				},
				],
				activeName:0
			};
		},
		onReachBottom() {
			if(this.activeName == 0){
				this.$refs.history.scrollBottom()
			}else if(this.activeName == 1){
				this.$refs.company.scrollBottom()
			}else if(this.activeName == 2){
				this.$refs.gongneng.scrollBottom()
			}
			
		},
		onLoad(option){
		},
		methods:{
			clicktab(e){
				this.activeName = e.index
				if(this.activeName == 1){
					this.$refs.company.getList()
				}else if(this.activeName == 2){
					this.$refs.gongneng.getList()
				}else{
					this.$refs.history.getList()
				}
			}
		}
	}
</script>

<style lang="scss">
	page{
		background: #FAFAFA;
	}
	
	.tabbar-wrap{
		background-color: #fff;
		position: fixed;
		width: 100%;
		top: 0;
		left: 0;
	}
	.status_bar{
		height: var(--status-bar-height);
		width: 100%;
		background-color: #fff;

	}
</style>
